package io.elegant.sessions.widgets

import android.content.Context
import androidx.appcompat.widget.AppCompatTextView
import io.elegant.Elegant
import io.elegant.ElegantApiGrpc
import io.elegant.widgets.BaseTextWidget
import io.grpc.stub.StreamObserver
import kotlin.reflect.KClass

class WidgetTextSession(
    stub: ElegantApiGrpc.ElegantApiStub,
    context: Context
): BaseWidgetSession<AppCompatTextView, BaseTextWidget<AppCompatTextView>>(stub, context) {
    override val clazz = AppCompatTextView::class
    @Suppress("UNCHECKED_CAST")
    override val widgetClazz = BaseTextWidget::class as KClass<BaseTextWidget<AppCompatTextView>>
    override val sendStreamObserver: StreamObserver<Elegant.Interaction> = stub.widgetText(receiveStreamObserver)

}